import React, { Component } from 'react'
import { Link } from 'react-router-dom'

class HotCompanyList extends Component {
  constructor (props) {
    super (props)
    this.state = {
      data: JSON.parse(window.localStorage.hotComList)
    }
  }
  render () {
    return (
      <div>
        <div className="goback">
          <Link to="/">返回</Link>
        </div>
        {this.getList()}
      </div>
    )
  }
  getList () {
    let list = this.state.data;
      return (
        <div 
          className="hot-company m-b-3"
          style={{marginTop: "1.2rem"}}
        >
          <div className="hot-title">
            <p>{list.title}</p>
          </div>
          <ul className="hot-im-list">
            {
              list.list.map((child, index) => {
                return (
                  <li 
                   key={child.id}
                   onClick={()=> window.location="http://job.lockinchina.com/company/companyDetail?companyId="+child.companyId+""}
                  >
                    <div>
                        <div className="im">
                          <img alt="" src={child.imageUrl} />
                        </div>
                        <img alt="" src={require('../static/images/png.png')} />
                    </div>
                  </li>
                )
              })
            }
          </ul>
        </div>
      )
  }
}

export default HotCompanyList